package com.gongye.courseselectionsystem.utils;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author baorongchuan
 */
@Component
public class SendStudentMail {
    @Resource
    private MailUtil mailUtil;

    @RabbitListener(queues = {"myDirectQueue"})
    public void directReceive(String message) {
        String[] strings = message.split(":");
        int length = strings.length;
        String mail = strings[length - 1];
        mailUtil.sendTextMail(mail, "选课内容", message);
    }


}
